package com.pansoft.mobilemallpay.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.efounder.constant.EnvironmentVariable;

import java.util.HashMap;

/**
 * 请求支付的bean ,
 */

public class OrderBean implements Parcelable {
    private String title;
    String goodid;
    String body;
    String subject;
    String appbh = EnvironmentVariable.getProperty("pay_key");//配置文件中读取;
    String method = "apppay";//默认值
    String totalamount;//价格
    String userid = EnvironmentVariable.getUserID();
    private String goodName;

    public String getTitle() {
        return title;
    }

    public OrderBean setTitle(String title) {
        this.title = title;
        return this;
    }



    public String getUserid() {
        return userid;
    }

    public OrderBean setUserid(String userid) {
        this.userid = userid;
        return this;
    }

    public String getMethod() {
        return method;
    }

    public OrderBean setMethod(String method) {
        this.method = method;
        return this;
    }

    public String getTotalamount() {
        return totalamount;
    }

    public OrderBean setTotalamount(String totalamount) {
        this.totalamount = totalamount;
        return this;
    }

    public String getGoodid() {
        return goodid;
    }

    public OrderBean setGoodid(String goodid) {
        this.goodid = goodid;
        return this;
    }

    public String getBody() {
        return body;
    }

    public OrderBean setBody(String body) {
        this.body = body;
        return this;
    }

    public String getSubject() {
        return subject;
    }

    public OrderBean setSubject(String subject) {
        this.subject = subject;
        return this;
    }

    public String getAppbh() {
        return appbh;
    }

    public OrderBean setAppbh(String appbh) {
        this.appbh = appbh;
        return this;
    }


    public HashMap<String, String> getOrderBeanMap() {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("goodid", goodid);
        hashMap.put("body", body);
        hashMap.put("subject", subject);
        hashMap.put("appbh", appbh);
        hashMap.put("method", method);
        hashMap.put("totalamount", totalamount);
        hashMap.put("userid", userid);
        return hashMap;

    }

    public OrderBean() {
    }

    public OrderBean setGoodName(String goodName) {
        this.goodName = goodName;
        return this;
    }

    public String getGoodName() {
        return goodName;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.title);
        dest.writeString(this.goodid);
        dest.writeString(this.body);
        dest.writeString(this.subject);
        dest.writeString(this.appbh);
        dest.writeString(this.method);
        dest.writeString(this.totalamount);
        dest.writeString(this.userid);
        dest.writeString(this.goodName);
    }

    protected OrderBean(Parcel in) {
        this.title = in.readString();
        this.goodid = in.readString();
        this.body = in.readString();
        this.subject = in.readString();
        this.appbh = in.readString();
        this.method = in.readString();
        this.totalamount = in.readString();
        this.userid = in.readString();
        this.goodName = in.readString();
    }

    public static final Creator<OrderBean> CREATOR = new Creator<OrderBean>() {
        @Override
        public OrderBean createFromParcel(Parcel source) {
            return new OrderBean(source);
        }

        @Override
        public OrderBean[] newArray(int size) {
            return new OrderBean[size];
        }
    };
}
